package com.java.business.controller;

import com.java.business.model.Checkin;
import com.java.business.model.MaintainRecord;
import com.java.business.service.MaintainRecordService;
import com.java.common.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 维修保养记录
 */
@RestController
@RequestMapping("/maintainRecord")
public class MaintainRecordController {

    @Autowired
    private MaintainRecordService maintainRecordService;

    @PostMapping("/list")
    public Result list(@RequestBody MaintainRecord maintainRecord) {
        return maintainRecordService.list(maintainRecord);
    }

    @PostMapping("/saveMaintainRecord")
    public Result save(@RequestBody MaintainRecord maintainRecord) {
        return maintainRecordService.save(maintainRecord);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody MaintainRecord maintainRecord) {
        return maintainRecordService.modify(maintainRecord);
    }

    @PostMapping("/get")
    public Result get(int id) {
        return maintainRecordService.get(id);
    }

    @GetMapping("/remove")
    public Result remove(int[] ids) {
        return maintainRecordService.remove(ids);
    }

    /**
     * 查询类型
     * @return
     */
    @PostMapping("/listAll")
    public Result listAll() {
        return maintainRecordService.listAll();
    }

    @PostMapping("/listRecord")
    public Result listRecord(@RequestBody MaintainRecord maintainRecord) {
        return maintainRecordService.listRecord(maintainRecord);
    }

}
